/**
 * Created by songnaibing on 23/11/17.
 */

window.onload = passwordStyleLineStyle();
function passwordStyleLineChange(t ,funSu, funEr){
    var inputE = $(t),
        lis = inputE.siblings('ul').find('li'),
        inputEVal = inputE.val(),
        items = $('.aip-password-style-line .aip-content ul li'),
        itemWidth = items.width();
    lis.removeClass('aip-selected').css({'height': '2px', 'margin-top': itemWidth/2-1});
    for(var i=0; i < inputEVal.length; i++){
        lis.eq(i).addClass('aip-selected').css({'height': itemWidth, 'margin-top': 0});
    }
    if(inputEVal.length == 6){
        funSu();
    }
    else{
        funEr();
    }
}
function passwordStyleLineStyle(){
    var items = $('.aip-password-style-line .aip-content ul li'),
        inputE = items.parent().siblings('.aip-input'),
        parent = items.parents('.aip-content'),
        selected = parent.find('.aip-selected'),
        itemWidth = items.width();
    parent.css('height', itemWidth);
    inputE.css('height', itemWidth).focus();
    items.css('margin-top', itemWidth/2-1);
    selected.css({'height': itemWidth, 'margin-top': 0});
}
//
function callBackSu(){
    $('#btn').removeClass('btn-disabled');
}
function callBackEr(){
    $('#btn').addClass('btn-disabled');
}